package com.nageffer.shortlink.project;

import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class test {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void testSimpleQueue() {
        //交换机名称
        String exchangeName = "shortLink.exchange";
        //消息
        String message = "hello, spring amqp!";
        //路由key
        String key = "shortLink";

        // 发送消息
        rabbitTemplate.convertAndSend(exchangeName, key, message);
    }

}
